import {get, post, put, del} from './request'
import {API} from '../config/http.config'

export function getOrders(options={}){
    return get(API.getOrdersById, options)
}

export function getCategories(options={}){
    return get(API.getCategoriesById, options)
}

export function getProducts(options={}){
    return get(API.getProductsById, options)
}

export function getUsers(options={}){
    return get(API.getUsersById, options)
}

export function getRoles(options={}){
    return get(API.getRoles, options)
}

export function updateCategories(data, options={}){
    return post(API.updateCategories,data,  options)
}

export function updateProducts(data, options={}){
    return post(API.updateProducts, data, options)
}
export function updateUsers(data, options={}){
    return post(API.updateUsers, data, options)
}
export function updateOrders(data, options={}){
    return post(API.updateOrders, data, options)
}

export function deleteOrders(data, options={}){
    return del(API.deleteOrders, {data, ...options})
}
export function deleteCategories(data, options={}){
    return del(API.deleteCategories, {data, ...options})
}
export function deleteProducts(data, options={}){
    return del(API.deleteProducts, {data, ...options})
}
export function deleteUsers(data, options={}){
    return del(API.deleteUsers, {data, ...options})
}